#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool haveConflict(vector<string>& event1, vector<string>& event2) {
        vector<string> v1(event1.begin(), event1.end());
        v1.push_back(event2[0]);
        v1.push_back(event2[1]);
        sort(v1.begin(), v1.end());
        if (v1[0] == event1[0])
        {
            if (v1[1] != event1[1])
                return true;
        }
        else
        {
            if (v1[1] != event2[1])
                return true;
        }
        if (v1[1] != v1[2])
            return false;
        else
            return true;
    }
};